package cn.ztuo.bitrade.controller.system;

import cn.ztuo.bitrade.annotation.AccessLog;
import cn.ztuo.bitrade.constant.AdminModule;
import cn.ztuo.bitrade.constant.PageModel;
import cn.ztuo.bitrade.controller.common.BaseAdminController;
import cn.ztuo.bitrade.entity.AdminAccessLog;
import cn.ztuo.bitrade.entity.QAdmin;
import cn.ztuo.bitrade.entity.QAdminAccessLog;
import cn.ztuo.bitrade.entity.SysSite;
import cn.ztuo.bitrade.service.AdminAccessLogService;
import cn.ztuo.bitrade.service.AdminService;
import cn.ztuo.bitrade.service.SysSiteService;
import cn.ztuo.bitrade.util.MessageResult;
import com.querydsl.core.types.dsl.BooleanExpression;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;

import static org.springframework.util.Assert.notNull;

/**
 * @author fiwork.net
 * @description 日志管理
 * @date 2019/12/22 17:27
 */
@Slf4j
@RestController
@RequestMapping("/system/site")
@Api(value = "站点管理api",tags = "站点管理api")
public class SiteController extends BaseAdminController {

    @Autowired
    private SysSiteService siteService;

    @PostMapping("/findSite")
    @ApiOperation(value = "查询产品列表", notes = "查询产品列表")
    public MessageResult findSite() {
        return MessageResult.getSuccessInstance("",siteService.findAll());
    }

    @PostMapping("/updateSite")
    @ApiOperation(value = "修改站点信息", notes = "修改站点信息")
    public MessageResult updateSite(@Valid SysSite site) {
        return MessageResult.getSuccessInstance("",siteService.saveAndFlush(site));
    }

}
